package com.ss.android.m.c;

import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
import android.view.SurfaceHolder;

import com.ss.android.m.c.a.b;

public class aa implements com.ss.android.m.aa.a$a {
    private final Object a;
    public com.ss.android.m.c.a.a c;
    public Handler d;
    public com.ss.android.m.aa e;
    public HandlerThread f;

    public aa(com.ss.android.m.c.a.a arg3, Handler arg4) {
        this.a = new Object();
        this.c = arg3;
        this.d = arg4;
        if (this.d != null && this.c != null) {
            this.c.a(new b(this));
        }
    }

    public final void a(Message arg5) {
        Object v1_1;
        if (arg5 == null) {
            return;
        }

        if (this.d == null) {
            return;
        }

        Bundle v0 = arg5.getData();
        try {
            switch (arg5.what) {
                case 100: {
                    this.c.a();
                    this.d.obtainMessage(300).sendToTarget();
                    return;
                }
                case 101: {
                    this.c.b();
                    this.d.obtainMessage(301).sendToTarget();
                    return;
                }
                case 102: {
                    this.c.c();
                    this.d.obtainMessage(302).sendToTarget();
                    return;
                }
                case 103: {
                    this.c.d();
                    this.d.obtainMessage(303).sendToTarget();
                    return;
                }
                case 104: {
                    this.c.e();
                    return;
                }
                case 105: {
                    this.c.f();
                    this.d.obtainMessage(305).sendToTarget();
                    return;
                }
                case 106: {
                    this.c.a(v0.getLong(com.ss.android.m.a.a.k));
                    return;
                }
                case 107: {
                    String v0_2 = v0.getString(com.ss.android.m.a.a.l);
                    this.c.a(v0_2);
                    Message v1 = this.d.obtainMessage(306);
                    v1.getData().putString(com.ss.android.m.a.a.l, v0_2);
                    this.d.sendMessage(v1);
                    return;
                }
                case 109: {
                    v1_1 = this.a;
                    synchronized (v1_1) {
                        this.c.a((SurfaceHolder) arg5.obj);
                    }
                    this.d.obtainMessage(307).sendToTarget();
                    return;
                }
            }
        } catch (Exception v0_1) {
            label_15:
            v0_1.printStackTrace();
            Message v0_4 = this.d.obtainMessage(401, v0_1);
            v0_4.getData().putInt(com.ss.android.m.a.a.m, arg5.what);
            this.d.sendMessage(v0_4);
            return;
        }
    }
}

